<?php
$v_customer_name= "";
if(isset($_REQUEST['hdn_customer_name'])){
	$v_customer_name = $_REQUEST['hdn_customer_name'];
}
$v_customer_name = trim($v_customer_name);
$v_customer_card_id = "";
if(isset($_REQUEST['hdn_customer_card_id'])){
	$v_customer_card_id = $_REQUEST['hdn_customer_card_id'];
}
$v_customer_card_id = trim($v_customer_card_id);
$v_record_id = "";
if(isset($_REQUEST['hdn_record_id'])){
	$v_record_id = $_REQUEST['hdn_record_id'];
}
	
$v_worktype= "";
if(isset($_REQUEST['hdn_worktype'])){
	$v_worktype = $_REQUEST['hdn_worktype'];
}

if ($v_worktype!="CHECK"){
	if(_is_sqlserver()){//CSDL MSSQL 
		// Lay noi dung cua mot ho so
		$sql = "Exec Onegate_CheckCustomerSigon ";
		$sql = $sql. "" . $v_record_id ."";
		$sql = $sql. ",'" . $v_customer_name ."'";
		$sql = $sql. ",'" . $v_customer_card_id ."'";
		//echo $sql;exit;
		$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
		$arr_single_record = $ado_conn->GetRow($sql);
		$v_error = _replace_bad_char(trim($arr_single_record['RET_ERROR'])); 
	}
	sleep(0);
	if (!is_null($v_error) && $v_error<>""){?>
		<script>
			alert("<?php echo $v_error; ?>");
			if (_MODAL_DIALOG_MODE==1){
				window.location = "<?php echo $v_goto_url; ?>";
			}else{
				window.history.back();
			}	
		</script><?php
		exit;
	}
}
?>